#include<iostream>
#include<ostream>
using std::cout;
using std::endl;
using std::ostream;
class Point{

public:
    Point(int x,int y)
    :_ix(x)
    ,_iy(y)
    {
        
    }

    //重载<<
    ostream& operator<<(ostream &cout)
    {
        cout<<"point: " <<_ix<< ","<<_iy<<endl;
        return cout;
    }
    //友元 普通成员函数
    friend
    Point PointAdd(const Point &lhs,const Point &rhs);

private:
    int _ix;
    int _iy;
};

//成员函数形式
Point PointAdd(const Point &lhs,const Point &rhs){
    return Point(lhs._ix+rhs._ix,lhs._iy+rhs._iy);
}

void test0(){
    
    Point p1(1,1);
    Point p2(2,3);
    //返回的究竟是谁？？？ 是流模型！
    Point p3 = PointAdd(p1,p2);
    p3.operator<<(cout);
    int i = 1;
    //cout<<i<<endl; +

}
int main(void){

    test0();
    return 0;
}